#!/bin/bash
# MasterSketch Studio launcher
RES="$(cd "$(dirname "$0")/../Resources" && pwd)"
PAGE="file://$RES/index.html"
for B in "Google Chrome" "Microsoft Edge" "Brave Browser" "Chromium" "Vivaldi"; do
  for D in "/Applications" "$HOME/Applications"; do
    if [ -d "$D/$B.app" ]; then
      open -na "$D/$B.app" --args --app="$PAGE" --window-size=1440,920
      exit 0
    fi
  done
done
open -a Safari "$RES/index.html" 2>/dev/null || open "$RES/index.html"
